/* -----------------------------------------------------------------------
 * Don't forget to include the following lines in your makefile:
 *
 * testFileName: testFileName.c dominion.o rngs.o
 *      gcc -o testFileName -g  testFileName.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 *
 *  unittest1 tests the getCost() function
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
//#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1
#define NUMTESTCARDS 27

int main() {
    int i = 0;
    int result = -1;
    int testCard[NUMTESTCARDS] = {curse, estate, duchy, province, copper, silver
               , gold, adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall, minion
               , steward, tribute, ambassador, cutpurse, embargo, outpost
               , salvager, sea_hag, treasure_map};
    int cardVal[NUMTESTCARDS] = {0,2,5,8,0,3,6,6,5,4,4,5,4,4,3,4,3,5,3,5,3,4,2,5,4,4,4};

    printf ("TESTING getCost():\n");

    for(i; i < NUMTESTCARDS; i++){
#if (NOISY_TEST == 1)
        printf("Test card %d:\t", testCard[i]);
#endif
        result = getCost(testCard[i]);
#if (NOISY_TEST == 1)
        printf("Expected %d:\t Result %d\n", cardVal[i], result);
#endif
        assert(result == cardVal[i]);
    }

#if (NOISY_TEST == 1)
        printf("Tests Passed!!");
#endif

    return 0;
}
